auto.waitFor() //等待无障碍服务准备就绪
engines.all().map((ScriptEngine) => {
  if (engines.myEngine().toString() !== ScriptEngine.toString()) {
    ScriptEngine.forceStop();
  }
});

var url = "https://gitee.com/little-try/autojs/raw/master/%E5%BF%AB%E6%89%8B%E8%BE%85%E5%8A%A9.js";
try {
    var res = http.get(url);
    if (res.statusCode != 200) {
        toastLog("请求失败: 状态码 " + res.statusCode);
    } else {
        toastLog("请求成功: 状态码 " + res.statusCode);
        // 获取文件内容
        var content = res.body.string();
        toastLog("正在执行远程代码...");
        // 直接执行远程代码
        engines.execScript("remoteScript", content);
    }
} catch (e) {
    toastLog("发生错误: " + e);
}
